Trying to fix HTTP Status

James Peret 8 年之前
父节点
当前提交
8b9d7d0309
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      app/models/agents/http_status_agent.rb

+ 2 - 3
app/models/agents/http_status_agent.rb

@@ -76,12 +76,11 @@ module Agents
76 76
       start = Time.now.to_f
77 77
       measured_result = ping(url)
78 78
       total_time = Time.now.to_f - start
79
-      puts measured_result
80 79
 
81
-      current_status = measured_result ? measured_result.status.to_s : ''
80
+      current_status = measured_result.status.to_s
82 81
       return if options['changes_only'] == 'true' && current_status == memory['last_status'].to_s
83 82
 
84
-      payload = { 'url' => url, 'response_received' => false, 'elapsed_time' => total_time, 'status' => measured_result.status.to_s }
83
+      payload = { 'url' => url, 'response_received' => false, 'elapsed_time' => total_time }
85 84
 
86 85
       # Deal with failures
87 86
       if measured_result